package hhm.android.library.weightHeightPicker.heightPicker;

import androidx.annotation.NonNull;

import java.util.ArrayList;

public class INAdapter extends BaseHeightAdapter {

    public INAdapter(@NonNull HeightParams dateParams, @NonNull HeightPick datePick, int selectColor) {
        super(dateParams, datePick, selectColor);
    }

    @Override
    public String getItem(int position) {
        int number = mData.get(position);
        return "" + number;
    }

    @Override
    public int getCurrentIndex() {
        return mData.indexOf(mDatePick.mm);
    }

    @Override
    public void refreshValues() {
        ArrayList<Integer> values = new ArrayList<>();
        if (mDatePick.cm == 0) {
            for (int i = 8; i <= 11; i++) {
                values.add(i);
            }
        } else if (mDatePick.cm == 6) {
            for (int i = 0; i <= 7; i++) {
                values.add(i);
            }
        } else {
            for (int i = 0; i <= 11; i++) {
                values.add(i);
            }
        }
        setData(values);
    }

    @Override
    public String getCla() {
        return "in";
    }
}

